function closeTab() {
	parent.$('#content').tabs('close', '个人资料管理');
}

function doSubmit() {
	var empName = $.trim($('#empName').val());
	if (empName == '') {
		$.messager.alert('确定', '<b>用户姓名不能为空</b>', 'warning');
		
		return false;
	}
	
	var linkPhone = $.trim($('#linkPhone').val());
	if (linkPhone == '') {
		$.messager.alert('确定', '<b>联系电话不能为空</b>', 'warning');
		
		return false;
	}
	
	var email = $.trim($('#email').val());
	if (email == '') {
		$.messager.alert('确定', '<b>邮箱不能为空</b>', 'warning');
		
		return false;
	}else {
		 var emailReg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
		 if (!emailReg.test(email)) {
		 	$.messager.alert('确定', '<b>请输入正确的邮箱格式</b>', 'warning');
		 	return false;
		 }
	}
	
	var workEntity = $.trim($('#workEntity').val());
	if (workEntity == '') {
		$.messager.alert('确定', '<b>工作地址不能为空</b>', 'warning');
		
		return false;
	}
	
	var idCard = $.trim($('#idCard').val());
	if (idCard != '' && !(idCard.length == 18 || idCard.length == 15)) {
		$.messager.alert('确定', '<b>请输入正确的身份证号码</b>', 'warning');
		
		return false;
	}
	
	var params = {
		"employee.empID" : $.trim($('#empID').val()),
		"employee.empName" : empName,
		"employee.email" : email,
		"employee.userType" : $('#userType').val(),
		"employee.sex" : $('[name="employee.sex"][checked=true]:radio').val(),
		"employee.mobilePhone" : $.trim($('#mobilePhone').val()),
		"employee.workEntity" : workEntity,
		"employee.linkPhone" : $('#linkPhone').val(),
		"employee.idCard" : $.trim($('#idCard').val()),
		"employee.education" : $.trim($('#education').val()),
		"employee.remark" : $.trim($('#remark').val())
	};
	
	var option = {
   		type: 'POST',
   		url: 'iemployee!updateUserInfo.action',
   		data: params,
   		success : function(msg){
	      if(msg=='success') {
	      	 $.messager.alert('确定', '恭喜您修改成功', 'info');
	      } else {
	     	 $.messager.alert('确定', '修改失败,请稍后执行', 'error');
	      }
		},
		error : function(XMLHttpRequest, textStatus, errorThrown) {
		     $.messager.alert('确定', '<br/><b>很遗憾，操作出现异常,状态为</b>'  + textStatus + ', 错误为： ' + errorThrown, 'error');
		}
	}
	
	$.ajax(option); 
}

